﻿<UserControl x:Class="StockholmsStad.Windows.UI.Modules.Couple.Controls.IndividualBookingControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:wpftoolkit="clr-namespace:Microsoft.Windows.Controls;assembly=WPFToolkit"
    xmlns:Converters="clr-namespace:StockholmsStad.Windows.UI.Infrastructure.Converters;assembly=StockholmsStad.Windows.UI.Infrastructure">
    <UserControl.Resources>
        <Converters:DateTimeToDateString x:Key="DateConverter" />
    </UserControl.Resources>

    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="5" />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="5" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <TextBox x:Name="TextBoxDate" Grid.Column="0" Grid.Row="0" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="0,4,0,0" Width="100" 
             Text="{Binding ElementName=calendarControl, Path=SelectedDate, Converter={StaticResource DateConverter}}" />
        
        <wpftoolkit:Calendar x:Name="calendarControl" Language="sv-SE" FirstDayOfWeek="Monday" Grid.Column="2" Grid.Row="0" />

        <Label Content="Välj en förrättare i listan nedan: " Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="3"/>

        <ComboBox x:Name="cbMinisters" Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="3" ItemsSource="{Binding Ministers}"
                  HorizontalAlignment="Left" VerticalAlignment="Top" Width="200">
            <ComboBox.ItemTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="{Binding Path=MinisterId}" Visibility="Collapsed" />
                        <TextBlock Text="{Binding Path=FullName}" />
                        <TextBlock Text=" (" />
                        <TextBlock Text="{Binding Path=MinisterCode}" />
                        <TextBlock Text=")" />
                    </StackPanel>
                </DataTemplate>
            </ComboBox.ItemTemplate>
        </ComboBox>


        <StackPanel Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="3" Margin="0,10,0,0" Orientation="Horizontal" HorizontalAlignment="Right">
            <Button x:Name="ChangeButton" Content="Ändra" IsEnabled="False" Visibility="Hidden" Click="ChangeButton_Click" />
            <Button x:Name="CancelButton" Content="Avboka" Command="{Binding CancelCommand}" IsEnabled="False" Margin="5,0,0,0" Click="CancelButton_Click" />
            <Button x:Name="SaveButton" Content="Boka" IsEnabled="False" Margin="5,0,0,0" Click="SaveButton_Click" />
        </StackPanel>

    </Grid>
    
</UserControl>